package com.itheima.blockingqueue;

import java.util.concurrent.LinkedBlockingQueue;

/*
阻塞队列的 特有方法

 */
public class Demo02 {
    public static void main(String[] args) throws InterruptedException {
        LinkedBlockingQueue<String> queue = new LinkedBlockingQueue<>(2);
        queue.put("煎饼1");
        queue.put("煎饼2");
        System.out.println(queue);
        String take = queue.take();
        System.out.println(take);
        queue.put("煎饼3");
        System.out.println(queue);
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());


    }
}
